﻿@model IEnumerable<Hostal.Bussines.Entities.Habitacion>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

@using (Html.BeginForm())
{
    <fieldset>
        <legend>Buscar Habitaciones</legend>
        <table>
            <tr>
                <td><b>Criterio:</b></td>
                <td>@Html.TextBox("criterio")</td>
                <td><input type="submit" name="btnBuscar" value="Buscar" /></td>
            </tr>
        </table>    
        
    </fieldset>
}

<table border="1">
    <tr>
        <th>
           <b>Id</b>
        </th>
        <th>
          <b>Tipo Habitacion</b>
        </th>
        <th>
           <b>Precio</b>
        </th>
        <th>
            <b>N° Habitacion</b>
        </th>
        <th>
           <b>Estado</b>
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.IdHabitacion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TipoHabitacione.Descripcion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Precio)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NroHabitacion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Estado)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.IdHabitacion }) |
            @Html.ActionLink("Details", "Details", new { id=item.IdHabitacion}) |
            @Html.ActionLink("Delete", "Delete", new { id=item.IdHabitacion })
        </td>
    </tr>
}

</table>
